package com.lx.note.web;

import com.lx.common.vo.Message;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Administrator on 2018/5/26 0026.
 */
public abstract class BaseController {

    @ExceptionHandler(value = Exception.class)
    @ResponseBody
    public ResponseEntity exceptionHandler(Exception e){
        System.out.println(e);
        return ResponseEntity.status(HttpStatus.OK).body(Message.fail(e.getMessage()));
    }

}
